#!/usr/bin/env python
# encoding: utf-8
# @author: qiaowei
# @license: (C) Copyright 2013-2019
# @contact: weiweiqiao@126.com
# @file: multithread_test.py
# @time: 2020/7/28 0028
# @desc:

import threading
from PySide2.QtCore import QThread
from PySide2.QtCore import QObject
from PySide2.QtCore import Signal

from multithread.worker import Worker
from multithread.worker_01 import WorkerFromQThread


class MultiThreadTest(QObject):
    def __init__(self):
        super().__init__()

        self.__thread_b = QThread()
        self.__worker_b = Worker()
        # self.send_msg_a.connect(self.__worker_a.do_something)
        self.send_msg_b.connect(self.__worker_b.do_something)
        # self.send_msg_b

    def start_multithread_move_to_thread(self):
        self.__worker_b.moveToThread(self.__thread_b)
        self.__thread_b.start()
        self.send_msg_b.emit('SS')

    # 定义无参数信号槽
    send_msg_b = Signal(str)
